package com.jiezuo.flowable.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jiezuo.auth.entity.User;
import com.jiezuo.flowable.entity.ProcessInstanceAddQuery;
import com.jiezuo.flowable.entity.ProcessInstancePageQuery;
import com.jiezuo.flowable.entity.ProcessInstanceStateQuery;
import com.jiezuo.common.vo.PageVo;

/**
 * @description 流程实例
 * @author 庞留杰
 * @date 2020/9/14 9:38
 * @version V1.0
 **/
public interface UserProcessInstanceService {

    /**
     * 功能描述: 启动：提交一个申请单
     *   启动流程实例(提交一个申请单)，实例启动成功，返回当前活动任务
     */
    String startByKey(User user, ProcessInstanceAddQuery request);

    /**
     * 功能描述: 分页查询流程实例【操作表：act_ru_execution】
     */
    Page findProcessInstancePage(PageVo pageVo, ProcessInstancePageQuery processInstancePageQuery);

    /**
     * 功能描述: 流程的挂起、激活
     */
    String editProcessInstanceState(ProcessInstanceStateQuery processInstanceStateQuery);

    /**
     * 删除流程
     * */
    void deleteByProcessInstance(String processInstanceId);

}
